home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume23 / jgraph / patch06a < prev    next >
Encoding:
Text File  |  1991-10-21  |  56.2 KB  |  2,013 lines

  1. Newsgroups: comp.sources.misc
  2. From: jsp@Princeton.EDU (James Plank)
  3. Subject:  v23i099:  jgraph - A filter for plotting postscript graphs, Patch06a/2
  4. Message-ID: <csm-v23i099=jgraph.221519@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: af0f6492b2d72ff8e258c1cfd716f715
  6. Date: Tue, 22 Oct 1991 03:18:08 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jsp@Princeton.EDU (James Plank)
  10. Posting-number: Volume 23, Issue 99
  11. Archive-name: jgraph/patch06a
  12. Environment: UNIX, VMS, postscript
  13. Patch-To: jgraph: Volume 16, Issue 20
  14.  
  15. This is the first part of a two part patch which brings jgraph to
  16. version 6.0.
  17.  
  18. Jgraph takes the description of a graph or graphs in the standard
  19. input, and produces a postscript file on the standard output.  Jgraph
  20. is ideal for plotting any mixture of scatter point graphs, line
  21. graphs, and/or bar graphs, and embedding the output into LaTeX, or
  22. any other text processing system which can read postscript.
  23.  
  24. The graph description language is simple enough to get nice looking
  25. graphs with a minimum of effort, yet powerful enough to give the user
  26. the flexibility to tailor the appearance of the graph to his or her
  27. individual preferences.  This includes plotting multiple graphs and
  28. laying them out separately on the page (or pages). 
  29.  
  30. The program is written in C, and shouldn't take anything too fancy
  31. or machine-dependent.  It has been tested on DECstations, 
  32. sun3's, and sparc's (and is being used on many other types
  33. of machines).
  34.  
  35. Jgraph is available via anonymous ftp to princeton.edu, in the
  36. file jgraph.Z.  This file is a compressed shell bundle file.
  37.  
  38. Please send me comments and/or bug reports.
  39.  
  40. Jim Plank
  41. jsp@princeton.edu
  42. --------------
  43. #!/bin/sh
  44. # This is a shell archive (produced by shar 3.49)
  45. # To extract the files from this archive, save it to a file, remove
  46. # everything above the "!/bin/sh" line above, and type "sh file_name".
  47. #
  48. # existing files will NOT be overwritten unless -c is specified
  49. #
  50. # This is part 1 of a multipart archive                                    
  51. # do not concatenate these parts, unpack them in order with /bin/sh        
  52. #
  53. # This shar contains:
  54. # length  mode       name
  55. # ------ ---------- ------------------------------------------
  56. #   1957 -rw-rw-r-- PATCH.6.README
  57. #  78625 -rw-rw-r-- patch.6
  58. #
  59. if test -r _shar_seq_.tmp; then
  60.     echo 'Must unpack archives in sequence!'
  61.     echo Please unpack part `cat _shar_seq_.tmp` next
  62.     exit 1
  63. fi
  64. # ============= PATCH.6.README ==============
  65. if test -f 'PATCH.6.README' -a X"$1" != X"-c"; then
  66.     echo 'x - skipping PATCH.6.README (File already exists)'
  67.     rm -f _shar_wnt_.tmp
  68. else
  69. > _shar_wnt_.tmp
  70. echo 'x - extracting PATCH.6.README (Text)'
  71. sed 's/^X//' << 'SHAR_EOF' > 'PATCH.6.README' &&
  72. Version 6.0 Of jgraph is finished.
  73. X
  74. For those that don't know, jgraph is a program which 
  75. takes the description of a graph or graphs in the standard
  76. input, and produces a postscript file on the standard output.  Jgraph
  77. is ideal for plotting any mixture of scatter point graphs, line
  78. graphs, and/or bar graphs, and embedding the output into LaTeX, or
  79. any other text processing system which can read postscript.
  80. X
  81. There is a mailing list for jgraph users to which I periodically
  82. send minor bug fixes.  Since the last patch to comp.sources.misc,
  83. jgraph has gone through the following revisions:
  84. X
  85. 5.1: Fixed a bug in hash label precisions.
  86. 5.2: Made the man page more universally readable,
  87. X     Added some files to make life easier for VMS users.
  88. 5.3: Added more linetypes: dotdash, longdash, etc, as 
  89. X     well as a general linetype mechanism.  Also put
  90. X     exit(0) into the code.
  91. 5.4: Added a newpage command for multi-page graphs.
  92. 5.5: Added clipping, so that points outside the axes 
  93. X     don't get printed.  Updated the first line of 
  94. X     output to the more general "%!PS-Adobe-2.0 EPSF-1.2"
  95. 6.0: Added arrowheads on curve lines.
  96. X     Added the ability to do grids.
  97. X     Added a bbox command for the user to specify a bounding box.
  98. X     Added gray scale on axes and lines.
  99. X
  100. If you'd like to be on the jgraph bug fix list, please
  101. send me email.  And please let me know of bug reports, 
  102. suggestions and comments.
  103. X
  104. The most recent version of jgraph is always available
  105. via anonymous ftp from princeton.edu in the file pub/jgraph.Z.
  106. This is a compressed shell file.  To unpack it, first 
  107. get it using ftp (first type "binary" before doing the get),
  108. and then do "zcat jgraph.Z | sh".
  109. X
  110. The patch in the file patch.6 is from revision 5.0, posted 
  111. to comp.sources.misc in May.  If you can't do the ftp 
  112. or get the patch to work, send me email, and I'll mail
  113. you the sources.
  114. X
  115. Take it easy,
  116. X
  117. Jim Plank
  118. jsp@cs.princeton.edu
  119. 35 Olden Street
  120. Princeton, NJ 08544-2087
  121. SHAR_EOF
  122. chmod 0664 PATCH.6.README ||
  123. echo 'restore of PATCH.6.README failed'
  124. Wc_c="`wc -c < 'PATCH.6.README'`"
  125. test 1957 -eq "$Wc_c" ||
  126.     echo 'PATCH.6.README: original size 1957, current size' "$Wc_c"
  127. rm -f _shar_wnt_.tmp
  128. fi
  129. # ============= patch.6 ==============
  130. if test -f 'patch.6' -a X"$1" != X"-c"; then
  131.     echo 'x - skipping patch.6 (File already exists)'
  132.     rm -f _shar_wnt_.tmp
  133. else
  134. > _shar_wnt_.tmp
  135. echo 'x - extracting patch.6 (Text)'
  136. sed 's/^X//' << 'SHAR_EOF' > 'patch.6' &&
  137. *** ../work/README    Tue Oct  8 17:36:09 1991
  138. --- README    Tue Oct  8 16:55:20 1991
  139. ***************
  140. *** 1,3 ****
  141. --- 1,5 ----
  142. + $Revision: 6.0 $
  143. X  Jgraph takes the description of a graph or graphs in the standard
  144. X  input, and produces a postscript file on the standard output.  Jgraph
  145. X  is ideal for plotting any mixture of scatter point graphs, line
  146. ***************
  147. *** 8,14 ****
  148. X  graphs with a minimum of effort, yet powerful enough to give the user
  149. X  the flexibility to tailor the appearance of the graph to his or her
  150. X  individual preferences.  This includes plotting multiple graphs and
  151. ! laying them out separately on the page. 
  152. X  
  153. X  The program is written in C, and shouldn't take anything too fancy
  154. X  or machine-dependent.  It has been tested on VAX mipsel's and mipseb's,
  155. --- 10,16 ----
  156. X  graphs with a minimum of effort, yet powerful enough to give the user
  157. X  the flexibility to tailor the appearance of the graph to his or her
  158. X  individual preferences.  This includes plotting multiple graphs and
  159. ! laying them out separately on the page (or pages). 
  160. X  
  161. X  The program is written in C, and shouldn't take anything too fancy
  162. X  or machine-dependent.  It has been tested on VAX mipsel's and mipseb's,
  163. ***************
  164. *** 17,22 ****
  165. --- 19,32 ----
  166. X  There is a makefile, a man page (in jgraph.1), source code, and 
  167. X  example graphs.
  168. X  
  169. + Jgraph is available via anonymous ftp to princeton.edu, in the
  170. + file jgraph.Z.  This file is a compressed shell bundle file.
  171. + There is also a mailing list in which I inform users directly 
  172. + about bug fixes.  This is for those who don't read comp.sources.misc,
  173. + or those who would like to hear about minor bug fixes which I
  174. + haven't posted as a patch to comp.sources.misc.
  175. X  Please send me comments and/or bug reports.
  176. X  
  177. X  Author: Jim Plank
  178. ***************
  179. *** 24,31 ****
  180. X  USmail:    Department of Computer Science
  181. X      Princeton University
  182. X      35 Olden St.
  183. !     Princeton, Nj 08544-2087
  184. !         
  185. !   
  186. --- 34,37 ----
  187. X  USmail:    Department of Computer Science
  188. X      Princeton University
  189. X      35 Olden St.
  190. !     Princeton, NJ 08544-2087
  191. *** ../work/descrip.mms    Tue Oct  8 17:36:10 1991
  192. --- descrip.mms    Tue Oct  8 16:55:13 1991
  193. ***************
  194. *** 1,10 ****
  195. ! CC = cc
  196. X  .ifdef DEBUG
  197. ! CFLAGS=/noopt/debug
  198. X  LFLAGS=/debug
  199. X  .else
  200. ! CFLAGS=
  201. X  LFLAGS=
  202. X  .endif
  203. X  
  204. --- 1,15 ----
  205. ! # VMS MMS makefile
  206. ! #
  207. ! # In the link you will get a warning because of the multiple definition
  208. ! # of exit(). This may be ignored; in order to get MMS completing without
  209. ! # trouble you will have to call MMS as follows:
  210. ! #    $ MMS/IGNORE
  211. ! #
  212. X  .ifdef DEBUG
  213. ! CFLAGS=/INCLUDE=(SYS$DISK:[],SYS$SHARE:)/noopt/debug
  214. X  LFLAGS=/debug
  215. X  .else
  216. ! CFLAGS=/INCLUDE=(SYS$DISK:[],SYS$SHARE:)
  217. X  LFLAGS=
  218. X  .endif
  219. X  
  220. ***************
  221. *** 16,36 ****
  222. X          prio_list.obj, \
  223. X          process.obj, \
  224. X          show.obj, \
  225. !         token.obj
  226. X  
  227. X  all :    jgraph.exe
  228. X      ! done
  229. X  
  230. ! .SUFFIXES : .jgr .jps .tex .dvi
  231. ! .jgr.jps :
  232. !     jgraph < $*.jgr > *.jps
  233. ! .tex.dvi :
  234. !     latex $*.tex
  235. X  jgraph.exe : $(OBJS)
  236. !     link $(LFLAGS) /exe=jgraph $(OBJS)
  237. X  
  238. X  ###
  239. X  draw.obj :    draw.c jgraph.h list.h prio_list.h
  240. --- 21,37 ----
  241. X          prio_list.obj, \
  242. X          process.obj, \
  243. X          show.obj, \
  244. !         token.obj, \
  245. !         exit.obj
  246. X  
  247. X  all :    jgraph.exe
  248. X      ! done
  249. X  
  250. ! # Do not link against the shareable image VAXCRTL.EXE, or you will
  251. ! # miss the reference to the local exit() routine.
  252. ! # EXIT will be reported as being multiply defined - ignore that.
  253. X  jgraph.exe : $(OBJS)
  254. !     link $(LFLAGS) /exe=jgraph $(OBJS),sys$library:vaxcrtl/libr
  255. X  
  256. X  ###
  257. X  draw.obj :    draw.c jgraph.h list.h prio_list.h
  258. ***************
  259. *** 42,44 ****
  260. --- 43,46 ----
  261. X  process.obj :    process.c jgraph.h list.h prio_list.h
  262. X  show.obj :    show.c jgraph.h list.h prio_list.h
  263. X  token.obj :    token.c list.h
  264. + exit.obj :    exit.c
  265. *** ../work/draw.c    Tue Oct  8 17:36:11 1991
  266. --- draw.c    Tue Oct  8 16:55:14 1991
  267. ***************
  268. *** 1,7 ****
  269. X  /* 
  270. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/draw.c,v $
  271. !  * $Revision: 5.0 $
  272. !  * $Date: 91/05/02 14:45:08 $
  273. X   * $Author: jsp $
  274. X   */
  275. X  
  276. --- 1,7 ----
  277. X  /* 
  278. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/draw.c,v $
  279. !  * $Revision: 6.0 $
  280. !  * $Date: 91/10/08 16:53:43 $
  281. X   * $Author: jsp $
  282. X   */
  283. X  
  284. ***************
  285. *** 46,53 ****
  286. X  
  287. X  #define MAXIMUM(a,b) ((a > b) ? a : b)
  288. X  
  289. ! draw_axis(a)
  290. ! Axis a;
  291. X  {
  292. X    char orientation;
  293. X    Hash h;
  294. --- 46,53 ----
  295. X  
  296. X  #define MAXIMUM(a,b) ((a > b) ? a : b)
  297. X  
  298. ! draw_axis(a, other)
  299. ! Axis a, other;
  300. X  {
  301. X    char orientation;
  302. X    Hash h;
  303. ***************
  304. *** 57,70 ****
  305. X    setlinewidth(1.0);
  306. X    if (a->draw_axis_line) {
  307. X      comment("Drawing Axis");
  308. X      printline(0.0, a->draw_at, a->psize, a->draw_at, orientation);
  309. X    }
  310. X    if (a->draw_hash_marks) {
  311. X      comment("Drawing Hash Marks");
  312. X      for (h = first(a->hash_lines); h != nil(a->hash_lines); h = next(h)) {
  313. !       printline(h->loc, 
  314. !                 a->draw_hash_marks_at, 
  315. !                 h->loc, 
  316. X                  a->draw_hash_marks_at + (h->size * a->hash_scale), 
  317. X                  orientation);
  318. X      }
  319. --- 57,69 ----
  320. X    setlinewidth(1.0);
  321. X    if (a->draw_axis_line) {
  322. X      comment("Drawing Axis");
  323. +     printf("gsave %f setgray\n", a->gray);
  324. X      printline(0.0, a->draw_at, a->psize, a->draw_at, orientation);
  325. X    }
  326. X    if (a->draw_hash_marks) {
  327. X      comment("Drawing Hash Marks");
  328. X      for (h = first(a->hash_lines); h != nil(a->hash_lines); h = next(h)) {
  329. !       printline(h->loc, a->draw_hash_marks_at, h->loc, 
  330. X                  a->draw_hash_marks_at + (h->size * a->hash_scale), 
  331. X                  orientation);
  332. X      }
  333. ***************
  334. *** 81,90 ****
  335. --- 80,95 ----
  336. X        draw_label(a->hl);
  337. X      }
  338. X    }
  339. +   if (a->grid_lines) {
  340. +     for (h = first(a->hash_lines); h != nil(a->hash_lines); h = next(h)) {
  341. +       printline(h->loc, 0.0, h->loc, other->psize, orientation);
  342. +     }
  343. +   }
  344. X    if (a->draw_axis_label) {
  345. X      comment("Drawing Axis Label");
  346. X      draw_label(a->label);
  347. X    }
  348. +   printf("  grestore\n");
  349. X  }
  350. X  
  351. X  
  352. ***************
  353. *** 96,109 ****
  354. --- 101,128 ----
  355. X    print_text(l->label, l->x, l->y, l->hj, l->vj, l->rotate, l->font, l->fontsize);
  356. X  }
  357. X  
  358. + set_clip(g)
  359. + Graph g;
  360. + {
  361. +   comment("Setting Clip");
  362. +   printf("newpath\n");
  363. +   printf(" 0 0 moveto 0 %f lineto %f %f lineto %f 0 lineto\n",
  364. +            g->y_axis->psize, g->x_axis->psize,
  365. +            g->y_axis->psize, g->x_axis->psize);
  366. +   printf("  closepath clip newpath\n");
  367. + }
  368. X  draw_curves(g)
  369. X  Graph g;
  370. X  {
  371. X    Curve c;
  372. X  
  373. +   printf("gsave\n");
  374. +   if (g->clip) set_clip(g);
  375. X    for(c = first(g->curves); c != nil(g->curves); c = next(c)) {
  376. X      draw_curve(c, g);
  377. X    }
  378. +   printf(" grestore\n");
  379. X  }
  380. X  
  381. X  draw_curve(c, g)
  382. ***************
  383. *** 112,128 ****
  384. X  {
  385. X    Point p;
  386. X    int i;
  387. X  
  388. X    if (c->linetype != '0') {
  389. -     comment("Drawing Curve Lines");
  390. -     
  391. X      i = 0;
  392. X      for (p = first(c->pts);
  393. X           p != nil(c->pts);
  394. X           p = next(p)) {
  395. X        if (i == 0) {
  396. !         start_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis), 
  397. !                         c->linethick, c->linetype);
  398. X        } else {
  399. X          cont_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis));
  400. X        } 
  401. --- 131,148 ----
  402. X  {
  403. X    Point p;
  404. X    int i;
  405. +    float this_x, this_y, last_x, last_y;
  406. X  
  407. +   printf("gsave %f setgray\n", c->gray);
  408. +   if (c->clip) set_clip(g);
  409. +   comment("Drawing Curve");
  410. X    if (c->linetype != '0') {
  411. X      i = 0;
  412. X      for (p = first(c->pts);
  413. X           p != nil(c->pts);
  414. X           p = next(p)) {
  415. X        if (i == 0) {
  416. !         start_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis), c);
  417. X        } else {
  418. X          cont_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis));
  419. X        } 
  420. ***************
  421. *** 138,145 ****
  422. X    for (p = first(c->pts);
  423. X         p != nil(c->pts);
  424. X         p = next(p)) {
  425. !       draw_mark(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis), c, g);
  426. X      }
  427. X  }
  428. X  
  429. X  draw_mark(x, y, c, g)
  430. --- 158,176 ----
  431. X    for (p = first(c->pts);
  432. X         p != nil(c->pts);
  433. X         p = next(p)) {
  434. !     this_x = ctop(p->x, g->x_axis);
  435. !     this_y = ctop(p->y, g->y_axis);
  436. !     draw_mark(this_x, this_y, c, g);
  437. !     if (p != first(c->pts)) {
  438. !       if (c->rarrows) 
  439. !         draw_arrow(this_x, this_y, last_x, last_y, c);
  440. !       if (c->larrows) 
  441. !         draw_arrow(last_x, last_y, this_x, this_y, c);
  442. X      }
  443. +     last_x = this_x;  
  444. +     last_y = this_y;  
  445. +   }
  446. +   printf("     grestore\n");
  447. X  }
  448. X  
  449. X  draw_mark(x, y, c, g)
  450. ***************
  451. *** 208,213 ****
  452. --- 239,261 ----
  453. X    }
  454. X  }
  455. X  
  456. + draw_arrow(x1, y1, x2, y2, c)
  457. + float x1, y1, x2, y2;
  458. + Curve c;
  459. + {
  460. +   float dx, dy;
  461. +   
  462. +   dx = x1 - x2;
  463. +   dy = y1 - y2;
  464. +   if (dx == 0.0 && dy == 0.0) return;
  465. +   printf("gsave %f %f translate %f %f atan rotate\n", x1, y1, dy, dx);
  466. +   start_poly(0.0, 0.0);
  467. +   cont_poly(-(c->asize[0]), (c->asize[1]));
  468. +   cont_poly(-(c->asize[0]), -(c->asize[1]));
  469. +   end_poly(c->fill);
  470. +   printf("      grestore\n");
  471. + }
  472. X  draw_legend(g)
  473. X  Graph g;
  474. X  {
  475. ***************
  476. *** 220,233 ****
  477. X    if (l->type == 'n') return;
  478. X    for (c = first(g->curves); c != nil(g->curves); c = next(c)) {
  479. X      if (c->l->label != CNULL) {
  480. X        y = c->l->y - (c->l->fontsize / 2.0 * FCPI / FPPI);
  481. X        if (l->anylines) {
  482. !         if (c->linetype != '0') {
  483. X            x = c->l->x - l->midspace - l->linelength;
  484. !           start_line(x, y, c->linethick, c->linetype); 
  485. X            cont_line(x+l->linelength, y);
  486. X            end_line();
  487. X          }
  488. X          x = c->l->x - l->midspace - l->linelength / 2.0;
  489. X        } else x = c->l->x - l->midspace;
  490. X        if (c->marktype == 'X' || c->marktype == 'Y') {
  491. --- 268,284 ----
  492. X    if (l->type == 'n') return;
  493. X    for (c = first(g->curves); c != nil(g->curves); c = next(c)) {
  494. X      if (c->l->label != CNULL) {
  495. +       printf("gsave %f setgray\n", c->gray);
  496. X        y = c->l->y - (c->l->fontsize / 2.0 * FCPI / FPPI);
  497. X        if (l->anylines) {
  498. !         if (c->linetype != '0' && l->linelength != 0) {
  499. X            x = c->l->x - l->midspace - l->linelength;
  500. !           start_line(x, y, c); 
  501. X            cont_line(x+l->linelength, y);
  502. X            end_line();
  503. X          }
  504. +         if (c->larrows) draw_arrow(x, y, x+l->linelength, y, c);
  505. +         if (c->rarrows) draw_arrow(x+l->linelength, y, x, y, c);
  506. X          x = c->l->x - l->midspace - l->linelength / 2.0;
  507. X        } else x = c->l->x - l->midspace;
  508. X        if (c->marktype == 'X' || c->marktype == 'Y') {
  509. ***************
  510. *** 239,244 ****
  511. --- 290,296 ----
  512. X        } else {
  513. X          draw_mark(x, y, c, g);
  514. X        }
  515. +       printf("grestore\n");
  516. X        draw_label(c->l);
  517. X      }
  518. X    }
  519. ***************
  520. *** 260,267 ****
  521. X    comment("Drawing New Graph");
  522. X    printf("%f %f translate\n", g->x_translate - g->x_axis->psize / 2.0, 
  523. X            g->y_translate);
  524. !   draw_axis(g->x_axis);
  525. !   draw_axis(g->y_axis);
  526. X    draw_label(g->title);
  527. X    draw_curves(g);
  528. X    draw_legend(g);
  529. --- 312,325 ----
  530. X    comment("Drawing New Graph");
  531. X    printf("%f %f translate\n", g->x_translate - g->x_axis->psize / 2.0, 
  532. X            g->y_translate);
  533. !   if (g->border) {
  534. !     printline(0.0, 0.0, 0.0, g->y_axis->psize, 'x');
  535. !     printline(0.0, 0.0, 0.0, g->x_axis->psize, 'y');
  536. !     printline(g->x_axis->psize, 0.0, g->x_axis->psize, g->y_axis->psize, 'x');
  537. !     printline(g->y_axis->psize, 0.0, g->y_axis->psize, g->x_axis->psize, 'y');
  538. !   }
  539. !   draw_axis(g->x_axis, g->y_axis);
  540. !   draw_axis(g->y_axis, g->x_axis);
  541. X    draw_label(g->title);
  542. X    draw_curves(g);
  543. X    draw_legend(g);
  544. ***************
  545. *** 271,292 ****
  546. X  
  547. X  }
  548. X  
  549. ! draw_graphs(gs)
  550. X  Graphs gs;
  551. X  {
  552. X    Graph g;
  553. X  
  554. !   draw_header(gs);
  555. !   for (g = first(gs->g); g != nil(gs->g); g = next(g)) {
  556. !     draw_graph(g);
  557. X    }
  558. -   draw_footer(gs);
  559. X  }
  560. X  
  561. ! draw_header(gs)
  562. X  Graphs gs;
  563. X  {
  564. !   printf("%%!\n");
  565. X    printf("%%%%Pages: 0\n");
  566. X    printf("%%%%BoundingBox: %f %f %f %f\n", gs->bb[0], gs->bb[1], gs->bb[2], gs->bb[3]);
  567. X    printf("%%%%EndComments\n");
  568. --- 329,355 ----
  569. X  
  570. X  }
  571. X  
  572. ! draw_graphs(gs, pp)
  573. X  Graphs gs;
  574. + int pp;
  575. X  {
  576. +   Graphs gs_p;
  577. X    Graph g;
  578. X  
  579. !   for (gs_p = first(gs); gs_p != nil(gs); gs_p = next(gs_p)) {
  580. !     draw_header(gs_p, pp);
  581. !     for (g = first(gs_p->g); g != nil(gs_p->g); g = next(g)) {
  582. !       draw_graph(g);
  583. !     }
  584. !     draw_footer(gs_p, pp);
  585. X    }
  586. X  }
  587. X  
  588. ! draw_header(gs, pp)
  589. X  Graphs gs;
  590. + int pp;
  591. X  {
  592. !   printf("%%!PS-Adobe-2.0 EPSF-1.2\n");
  593. X    printf("%%%%Pages: 0\n");
  594. X    printf("%%%%BoundingBox: %f %f %f %f\n", gs->bb[0], gs->bb[1], gs->bb[2], gs->bb[3]);
  595. X    printf("%%%%EndComments\n");
  596. ***************
  597. *** 301,307 ****
  598. X    printf("{$F2psEnteredState restore end} def\t%%%%EndProlog\n");
  599. X    printf("$F2psBegin\n");
  600. X    printf("%f 0 translate\n", gs->width / 2.0);
  601. !   if (gs->printable_postscript)
  602. X      printf("%f %f translate\n",
  603. X        ((8.5 * FCPI) - (gs->bb[2] - gs->bb[0])) / 2.0,     
  604. X        (gs->bb[3] > (5.5*FCPI)) ? (11*FCPI) - gs->bb[3] : (5.5*FCPI));
  605. --- 364,370 ----
  606. X    printf("{$F2psEnteredState restore end} def\t%%%%EndProlog\n");
  607. X    printf("$F2psBegin\n");
  608. X    printf("%f 0 translate\n", gs->width / 2.0);
  609. !   if (pp)
  610. X      printf("%f %f translate\n",
  611. X        ((8.5 * FCPI) - (gs->bb[2] - gs->bb[0])) / 2.0,     
  612. X        (gs->bb[3] > (5.5*FCPI)) ? (11*FCPI) - gs->bb[3] : (5.5*FCPI));
  613. ***************
  614. *** 309,317 ****
  615. X    printf("0.700 setlinewidth\n");
  616. X  }
  617. X  
  618. ! draw_footer(gs)
  619. X  Graphs gs;
  620. X  {
  621. X    printf("$F2psEnd\n");
  622. !   if (gs->printable_postscript) printf("showpage\n");
  623. X  }
  624. --- 372,381 ----
  625. X    printf("0.700 setlinewidth\n");
  626. X  }
  627. X  
  628. ! draw_footer(gs, pp)
  629. X  Graphs gs;
  630. + int pp;
  631. X  {
  632. X    printf("$F2psEnd\n");
  633. !   if (pp) printf("showpage\n");
  634. X  }
  635. *** ../work/edit.c    Tue Oct  8 17:36:13 1991
  636. --- edit.c    Tue Oct  8 16:55:14 1991
  637. ***************
  638. *** 1,7 ****
  639. X  /* 
  640. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/edit.c,v $
  641. !  * $Revision: 5.0 $
  642. !  * $Date: 91/05/02 14:45:11 $
  643. X   * $Author: jsp $
  644. X   */
  645. X  
  646. --- 1,7 ----
  647. X  /* 
  648. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/edit.c,v $
  649. !  * $Revision: 6.0 $
  650. !  * $Date: 91/10/08 16:53:44 $
  651. X   * $Author: jsp $
  652. X   */
  653. X  
  654. ***************
  655. *** 92,97 ****
  656. --- 92,99 ----
  657. X    a1->auto_hash_marks = a2->auto_hash_marks;
  658. X    a1->minor_hashes = a2->minor_hashes;
  659. X    a1->hash_scale = a2->hash_scale;
  660. +   a1->gray = a2->gray;
  661. +   a1->grid_lines = a2->grid_lines;
  662. X    a1->precision = a2->precision;
  663. X    a1->start_given = a2->start_given;
  664. X    a1->is_lg = a2->is_lg;
  665. ***************
  666. *** 111,116 ****
  667. --- 113,120 ----
  668. X    copy_axis(g->y_axis, prev(g)->y_axis);
  669. X    g->x_translate = prev(g)->x_translate;
  670. X    g->y_translate = prev(g)->y_translate;
  671. +   g->clip = prev(g)->clip;
  672. +   g->border = prev(g)->border;
  673. X  }
  674. X  
  675. X  edit_curve(c, g)
  676. ***************
  677. *** 120,125 ****
  678. --- 124,130 ----
  679. X    char inp_str[256];
  680. X    float x, y, f;
  681. X    Point p;
  682. +   Flist fl;
  683. X    int i;
  684. X  
  685. X    while ( getstring(inp_str) ) {
  686. ***************
  687. *** 182,187 ****
  688. --- 187,199 ----
  689. X          fprintf(stderr, "\n");
  690. X          exit(1);
  691. X        } else c->marktype = MARKTYPES[i];
  692. +     } else if (strcmp(inp_str, "glines") == 0) {
  693. +       while (getfloat(&f)) {
  694. +         fl = (Flist) get_node (c->gen_linetype);
  695. +         fl->f = f;
  696. +         insert(fl, c->gen_linetype);
  697. +       } 
  698. +       rejecttoken();
  699. X      } else if (strcmp(inp_str, "linetype") == 0) {
  700. X        if (!getstring(inp_str)) return;
  701. X        if (strcmp(inp_str, "none") == 0) c->linetype = '0';
  702. ***************
  703. *** 188,201 ****
  704. X        else if (strcmp(inp_str, "solid") == 0) c->linetype = 's';
  705. X        else if (strcmp(inp_str, "dotted") == 0) c->linetype = '.';
  706. X        else if (strcmp(inp_str, "dashed") == 0) c->linetype = '-';
  707. X        else {
  708. X          error_header(); fprintf(stderr, "Bad line type: %s\n", inp_str);
  709. !         error_header(); fprintf(stderr, "             Valid marks are %s.\n", 
  710. !           "solid, dottted, dashed, none");
  711. X          exit(1);
  712. X        }
  713. X      } else if (strcmp(inp_str, "linethickness") == 0) {
  714. X        if (!getfloat(&f)) rejecttoken(); else c->linethick = f;
  715. X      } else {
  716. X        rejecttoken();
  717. X        return;
  718. --- 200,241 ----
  719. X        else if (strcmp(inp_str, "solid") == 0) c->linetype = 's';
  720. X        else if (strcmp(inp_str, "dotted") == 0) c->linetype = '.';
  721. X        else if (strcmp(inp_str, "dashed") == 0) c->linetype = '-';
  722. +       else if (strcmp(inp_str, "longdash") == 0) c->linetype = 'l';
  723. +       else if (strcmp(inp_str, "dotdash") == 0) c->linetype = 'd';
  724. +       else if (strcmp(inp_str, "dotdotdash") == 0) c->linetype = 'D';
  725. +       else if (strcmp(inp_str, "dotdotdashdash") == 0) c->linetype = '2';
  726. +       else if (strcmp(inp_str, "general") == 0) c->linetype = 'g';
  727. X        else {
  728. X          error_header(); fprintf(stderr, "Bad line type: %s\n", inp_str);
  729. !         error_header(); fprintf(stderr, "             Valid marks are %s\n", 
  730. !           "solid, dotted, dashed, longdash, dotdash,"); 
  731. !         error_header(); fprintf(stderr, "             %s.\n", 
  732. !           "dotdotdash, dotdotdashdash, none");
  733. X          exit(1);
  734. X        }
  735. X      } else if (strcmp(inp_str, "linethickness") == 0) {
  736. X        if (!getfloat(&f)) rejecttoken(); else c->linethick = f;
  737. +     } else if (strcmp(inp_str, "gray") == 0) {
  738. +       if (!getfloat(&f)) rejecttoken(); else c->gray = f;
  739. +     } else if (strcmp(inp_str, "larrows") == 0) {
  740. +       c->larrows = 1;
  741. +     } else if (strcmp(inp_str, "nolarrows") == 0) {
  742. +       c->larrows = 0;
  743. +     } else if (strcmp(inp_str, "rarrows") == 0) {
  744. +       c->rarrows = 1;
  745. +     } else if (strcmp(inp_str, "norarrows") == 0) {
  746. +       c->rarrows = 0;
  747. +     } else if (strcmp(inp_str, "asize") == 0) {
  748. +       if (!getfloat(&f)) rejecttoken(); 
  749. +       else {
  750. +         c->asize[0] = f;
  751. +         if (!getfloat(&f)) rejecttoken(); 
  752. +         else c->asize[1] = f;
  753. +       }
  754. +     } else if (strcmp(inp_str, "clip") == 0) {
  755. +       c->clip = 1;
  756. +     } else if (strcmp(inp_str, "noclip") == 0) {
  757. +       c->clip = 0;
  758. X      } else {
  759. X        rejecttoken();
  760. X        return;
  761. ***************
  762. *** 336,341 ****
  763. --- 376,387 ----
  764. X        a->draw_axis_label = 0;
  765. X      } else if (strcmp(inp_str, "draw_axis_label") == 0) {
  766. X        a->draw_axis_label = 1;
  767. +     } else if (strcmp(inp_str, "no_grid_lines") == 0) {
  768. +       a->grid_lines = 0;
  769. +     } else if (strcmp(inp_str, "grid_lines") == 0) {
  770. +       a->grid_lines = 1;
  771. +     } else if (strcmp(inp_str, "gray") == 0) {
  772. +       if ( getfloat(&f)) a->gray = f; else rejecttoken();
  773. X      } else {
  774. X        rejecttoken(); 
  775. X        return;
  776. ***************
  777. *** 427,432 ****
  778. --- 473,486 ----
  779. X        if (!getfloat(&f)) rejecttoken(); else gs->height = f;
  780. X      } else if (strcmp(inp_str, "X") == 0) {
  781. X        if (!getfloat(&f)) rejecttoken(); else gs->width = f;
  782. +     } else if (strcmp(inp_str, "border") == 0) {
  783. +       g->border = 1;
  784. +     } else if (strcmp(inp_str, "noborder") == 0) {
  785. +       g->border = 0;
  786. +     } else if (strcmp(inp_str, "clip") == 0) {
  787. +       g->clip = 1;
  788. +     } else if (strcmp(inp_str, "noclip") == 0) {
  789. +       g->clip = 0;
  790. X      } else {
  791. X        rejecttoken();
  792. X        return;
  793. ***************
  794. *** 437,446 ****
  795. X  edit_graphs(gs)
  796. X  Graphs gs;
  797. X  {
  798. X    char inp_str[80];
  799. X    float f;
  800. !   int num;
  801. X  
  802. X    while ( getstring(inp_str) ) {
  803. X      if (strcmp(inp_str, "graph") == 0) {
  804. X        if (!getint(&num)) {
  805. --- 491,502 ----
  806. X  edit_graphs(gs)
  807. X  Graphs gs;
  808. X  {
  809. +   Graphs the_g;
  810. X    char inp_str[80];
  811. X    float f;
  812. !   int num, i;
  813. X  
  814. +   the_g = first(gs);
  815. X    while ( getstring(inp_str) ) {
  816. X      if (strcmp(inp_str, "graph") == 0) {
  817. X        if (!getint(&num)) {
  818. ***************
  819. *** 447,461 ****
  820. X          error_header(); fprintf(stderr, "\"graph\" not followed by number\n");
  821. X          exit(1);
  822. X        }
  823. !       edit_graph(get_graph(gs->g, num), gs);
  824. X      } else if (strcmp(inp_str, "newgraph") == 0) {
  825. !       if (first(gs->g) == nil(gs->g))
  826. !         edit_graph(new_graph(gs->g, 0), gs);
  827. !       else edit_graph(new_graph(gs->g, last(gs->g)->num + 1), gs);
  828. X      } else if (strcmp(inp_str, "Y") == 0) {
  829. !       if (!getfloat(&f)) rejecttoken(); else gs->height = f;
  830. X      } else if (strcmp(inp_str, "X") == 0) {
  831. !       if (!getfloat(&f)) rejecttoken(); else gs->width = f;
  832. X      } else {
  833. X        error_header(); fprintf(stderr, "Bad token: %s\n", inp_str);
  834. X        exit(1);
  835. --- 503,530 ----
  836. X          error_header(); fprintf(stderr, "\"graph\" not followed by number\n");
  837. X          exit(1);
  838. X        }
  839. !       edit_graph(get_graph(the_g->g, num), the_g);
  840. X      } else if (strcmp(inp_str, "newgraph") == 0) {
  841. !       if (first(the_g->g) == nil(the_g->g))
  842. !         edit_graph(new_graph(the_g->g, 0), the_g);
  843. !       else edit_graph(new_graph(the_g->g, last(the_g->g)->num + 1), the_g);
  844. X      } else if (strcmp(inp_str, "Y") == 0) {
  845. !       if (!getfloat(&f)) rejecttoken(); else the_g->height = f;
  846. X      } else if (strcmp(inp_str, "X") == 0) {
  847. !       if (!getfloat(&f)) rejecttoken(); else the_g->width = f;
  848. !     } else if (strcmp(inp_str, "newpage") == 0) {
  849. !       new_graphs(gs);
  850. !       the_g = last(gs);
  851. !     } else if (strcmp(inp_str, "bbox") == 0) {
  852. !       for (i = 0; i < 4; i++) {
  853. !         if (!getfloat(&f)) {
  854. !           error_header();
  855. !           fprintf("Bbox definition must have four numbers\n");
  856. !           exit(1);
  857. !         } else {
  858. !           the_g->bb[i] = f;
  859. !         }
  860. !       }
  861. X      } else {
  862. X        error_header(); fprintf(stderr, "Bad token: %s\n", inp_str);
  863. X        exit(1);
  864. *** /dev/null    Tue Oct  8 02:00:06 1991
  865. --- exit.c    Tue Oct  8 16:55:14 1991
  866. ***************
  867. *** 0 ****
  868. --- 1,49 ----
  869. + /*
  870. + **++
  871. + **  FUNCTIONAL DESCRIPTION:
  872. + **
  873. + **      Exit is a VMS replacement for the standard Unix exit function
  874. + **
  875. + **  FORMAL PARAMETERS:
  876. + **
  877. + **      error_code    integer passed by value (optional)
  878. + **
  879. + **  SIDE EFFECTS:
  880. + **
  881. + **      Exit will never return to calling program
  882. + **    VMS exit status ($STATUS) will be set
  883. + **--
  884. + **/
  885. + #include <varargs.h>
  886. + exit(va_alist)
  887. + va_dcl
  888. + {
  889. +     int        nargs;
  890. +     va_list        va;
  891. +     int        exit_code = 0;
  892. +     /*
  893. +      * Pick up the argument, if present
  894. +      */
  895. +     va_count(nargs);
  896. +     va_start(va);
  897. +     if (nargs > 0) exit_code = va_arg(va,int);
  898. +     /*
  899. +      * Set the VMS $STATUS to the appropriate value:
  900. +      *    if exit_code == 0 then $STATUS := success
  901. +      *    if exit_code >  0 then $STATUS := error
  902. +      *    if exit_code <  0 then $STATUS := severe_error
  903. +      * and perform exit.
  904. +      *
  905. +      * Note:
  906. +      *    the %X10000000 added to the actual success/error indicator
  907. +      *    will prevent DCL from printing a message.
  908. +      *    A 'on error' will be obeyed however.
  909. +      */
  910. +     if (exit_code == 0)        /* success    */
  911. +         sys$exit(0x10000001);
  912. +     else if (exit_code > 0)        /* error    */
  913. +         sys$exit(0x10000002);
  914. +     else                /* severe error    */
  915. +         sys$exit(0x10000004);
  916. + }
  917. *** ../work/jgraph.1    Tue Oct  8 17:36:18 1991
  918. --- jgraph.1    Tue Oct  8 16:55:19 1991
  919. ***************
  920. *** 20,52 ****
  921. X  graphs with a minimum of effort, yet powerful enough to give the user
  922. X  the flexibility to tailor the appearance of the graph to his or her
  923. X  individual preferences.  This includes plotting multiple graphs and
  924. ! laying them out separately on the page.
  925. X  .sp
  926. X  As an example, if the user wanted to simply plot the points (2,3),
  927. X  (4,5), (1,6), the following would be enough of a specification file:
  928. ! .EX
  929. ! newgraph
  930. ! newcurve pts 2 3 4 5 1 6
  931. ! .EE
  932. X  Now, if the user wanted to spruce the graph up by adding labels to
  933. X  the axes, connecting the points, and titling the graph, then the
  934. X  input could change to:
  935. ! .EX
  936. ! newgraph
  937. ! newcurve pts 2 3 4 5 1 6 linetype solid
  938. ! xaxis label : X axis
  939. ! yaxis label : Y axis
  940. ! title : This is an example graph
  941. ! .EE
  942. X  If the user instead wanted this to be a bar graph with different
  943. X  endpoints on the axes, he/she could simply change the input to:
  944. ! .EX
  945. ! newgraph
  946. ! xaxis min 0 max 5 label : X axis
  947. ! yaxis min 0 max 6 label : Y axis
  948. ! newcurve pts 2 3 4 5 1 6 marktype xbar
  949. ! title : This is an example bar graph
  950. ! .EE
  951. X  There are many more features of the description language, which are
  952. X  described below in the next section.  Features which are not embedded
  953. X  within the description language are: line and function interpolation,
  954. --- 20,58 ----
  955. X  graphs with a minimum of effort, yet powerful enough to give the user
  956. X  the flexibility to tailor the appearance of the graph to his or her
  957. X  individual preferences.  This includes plotting multiple graphs and
  958. ! laying them out separately on the page (or pages).
  959. X  .sp
  960. X  As an example, if the user wanted to simply plot the points (2,3),
  961. X  (4,5), (1,6), the following would be enough of a specification file:
  962. ! .PP
  963. ! .nf
  964. !     newgraph
  965. !     newcurve pts 2 3 4 5 1 6
  966. ! .fi
  967. ! .PP
  968. X  Now, if the user wanted to spruce the graph up by adding labels to
  969. X  the axes, connecting the points, and titling the graph, then the
  970. X  input could change to:
  971. ! .PP
  972. ! .nf
  973. !     newgraph
  974. !     newcurve pts 2 3 4 5 1 6 linetype solid
  975. !     xaxis label : X axis
  976. !     yaxis label : Y axis
  977. !     title : This is an example graph
  978. ! .fi
  979. ! .PP
  980. X  If the user instead wanted this to be a bar graph with different
  981. X  endpoints on the axes, he/she could simply change the input to:
  982. ! .PP
  983. ! .nf
  984. !     newgraph
  985. !     xaxis min 0 max 5 label : X axis
  986. !     yaxis min 0 max 6 label : Y axis
  987. !     newcurve pts 2 3 4 5 1 6 marktype xbar
  988. !     title : This is an example bar graph
  989. ! .fi
  990. ! .PP
  991. X  There are many more features of the description language, which are
  992. X  described below in the next section.  Features which are not embedded
  993. X  within the description language are: line and function interpolation,
  994. ***************
  995. *** 110,129 ****
  996. X  character after the ``:'' starts the string, and the next newline
  997. X  character terminates it.  Notice that in strings white-space is not
  998. X  ignored.  Thus, the string ``Graph #1'' can be denoted as:
  999. ! .EX
  1000. ! : Graph #1<newline>
  1001. ! .EE
  1002. X  or
  1003. ! .EX
  1004. ! :<newline>
  1005. ! Graph #1<newline>
  1006. ! .EE
  1007. X  This way of denoting strings allows the user to embed leading and
  1008. X  trailing spaces, as well as the null string.  For example, the
  1009. X  null string ``'' is represented by:
  1010. ! .EX
  1011. ! : <newline>
  1012. ! .EE
  1013. X  Once a string has been started, it may contain any character besides
  1014. X  a newline.  Specifically, it may contain the sequence ``(*'' or
  1015. X  ``include'' without starting a comment or including a file.
  1016. --- 116,139 ----
  1017. X  character after the ``:'' starts the string, and the next newline
  1018. X  character terminates it.  Notice that in strings white-space is not
  1019. X  ignored.  Thus, the string ``Graph #1'' can be denoted as:
  1020. ! .nf
  1021. !     : Graph #1<newline>
  1022. X  or
  1023. !     :<newline>
  1024. !     Graph #1<newline>
  1025. ! .fi
  1026. X  This way of denoting strings allows the user to embed leading and
  1027. X  trailing spaces, as well as the null string.  For example, the
  1028. X  null string ``'' is represented by:
  1029. ! .nf
  1030. !     : <newline>
  1031. ! .fi
  1032. X  Once a string has been started, it may contain any character besides
  1033. X  a newline.  Specifically, it may contain the sequence ``(*'' or
  1034. X  ``include'' without starting a comment or including a file.
  1035. ***************
  1036. *** 204,209 ****
  1037. --- 214,249 ----
  1038. X  and
  1039. X  \fBX\fR
  1040. X  respectively.
  1041. + .TP
  1042. + .B newpage
  1043. + This command is for plotting graphs on multiple pages.  After a 
  1044. + \fBnewpage,\fR
  1045. + the graphs that the user enters will be plotted on a new page.
  1046. + New graphs and strings will be numbered starting with 0.  
  1047. + Essentially, 
  1048. + \fBnewpage\fR
  1049. + is the same as appending together the output of separate calls of
  1050. + jgraph on the text before the 
  1051. + \fBnewpage,\fR
  1052. + and on the text after the 
  1053. + \fBnewpage.\fR
  1054. + \fBNewpage\fR
  1055. + will most likely produce bizarre results if the
  1056. + \fB\-P\fR
  1057. + option is not specified.
  1058. + .TP
  1059. + \fBbbox \fIfloat\fB \fIfloat\fB \fIfloat\fB \fIfloat\fB\fR
  1060. + Jgraph calculates a bounding box for the graph and
  1061. + includes it in the header of the postscript output.
  1062. + For the purposed of LaTeX, this is usually ok, as LaTeX doesn't
  1063. + clip outside of the bounding box.  Unfortunately, other programs
  1064. + do clip, and sometimes jgraph doesn't calculate the bounding box
  1065. + too well (text especially screws things up).  This command lets
  1066. + the user add his/her own bounding box.  The units of this are
  1067. + final postscript units.  It's probably best to use the -p option
  1068. + to see what the bounding box is that jgraph produces, and then
  1069. + alter that accordingly with
  1070. + \fBbbox\fR.
  1071. X  .PD
  1072. X  .RE
  1073. X  .LP
  1074. ***************
  1075. *** 263,272 ****
  1076. X  is to
  1077. X  \fBnewcurve.\fR
  1078. X  .TP
  1079. X  \fBinherit_axes\fR   
  1080. X  This lets the user ``inherit'' the values of the last
  1081. X  graph's axes.  It copies all the attributes of the previous graph's x
  1082. ! and y axes, as well as the x_translate and y_translate values. 
  1083. X  (Actually, this is a little bit of a lie, as it does not copy the
  1084. X  values of the 
  1085. X  \fB\fIhash_at\fB, \fImhash_at\fB,\fR
  1086. --- 303,336 ----
  1087. X  is to
  1088. X  \fBnewcurve.\fR
  1089. X  .TP
  1090. + \fBborder\fR
  1091. + .br
  1092. + .ns
  1093. + .TP
  1094. + \fBnoborder\fR
  1095. + \fBBorder\fR   
  1096. + draws a square border around the area defined by the axes.
  1097. + \fBNoborder\fR
  1098. + specifies no border.
  1099. + \fBNoborder\fR
  1100. + is the default.  
  1101. + .TP
  1102. + \fBclip\fR
  1103. + .br
  1104. + .ns
  1105. + .TP
  1106. + \fBnoclip\fR
  1107. + \fBClip\fR   
  1108. + specifies that all curves in the graph will be clipped -- that is,
  1109. + no points outside of the of axes will be plotted.  Clipping can also be
  1110. + specified on a per-curve basis.  The default is
  1111. + \fBnoclip\fR.
  1112. + .TP
  1113. X  \fBinherit_axes\fR   
  1114. X  This lets the user ``inherit'' the values of the last
  1115. X  graph's axes.  It copies all the attributes of the previous graph's x
  1116. ! and y axes, as well as the x_translate and y_translate values, and the
  1117. ! clipping. 
  1118. X  (Actually, this is a little bit of a lie, as it does not copy the
  1119. X  values of the 
  1120. X  \fB\fIhash_at\fB, \fImhash_at\fB,\fR
  1121. ***************
  1122. *** 446,451 ****
  1123. --- 510,525 ----
  1124. X  \fBdraw_hash_marks,\fR
  1125. X  and 
  1126. X  \fBdraw_hash_labels.\fR
  1127. + .TP
  1128. + \fBgrid_lines\fR
  1129. + .br
  1130. + .ns
  1131. + .TP
  1132. + \fBno_grid_lines\fR
  1133. + \fBGrid_lines\fR
  1134. + specifies to plot a grid line at each (major and minor) hash
  1135. + mark on this axis.  The default is 
  1136. + \fBno_grid_lines\fR.
  1137. X  .PD
  1138. X  .RE
  1139. X  .LP
  1140. ***************
  1141. *** 490,509 ****
  1142. X  option of
  1143. X  \fBjgraph\fR
  1144. X  .TP
  1145. X  \fBfill \|[\fIfloat\fB\|]\fR   
  1146. X  This sets the filling of marks which define an area
  1147. X  to fill (e.g.  ``box'', ``circle'', ``xbar'').  1.0 fills the mark with
  1148. X  white.  0.0 fills it with black.  Anything in between is differing
  1149. X  levels of gray.  Anything negative fills it with nothing (i.e.  makes
  1150. ! it see-through).  The default fill can be determined using the 
  1151. ! \fB\-p\fR
  1152. ! option of 
  1153. ! \fBjgraph.\fR
  1154. X  .TP
  1155. X  \fBgmarks \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR   
  1156. X  \fBGmarks\fR
  1157. ! is a way for the user to
  1158. ! define custom marks.  For each mark on 
  1159. X  \fB(x,y),\fR 
  1160. X  Each pair of 
  1161. X  \fB\|{\fIfloat_x\fB\|}, \|{\fIfloat_y\fB\|}, \fR
  1162. --- 564,584 ----
  1163. X  option of
  1164. X  \fBjgraph\fR
  1165. X  .TP
  1166. + \fBgray \|[\fIfloat\fB\|]\fR   
  1167. + This specifies the gray scale in which to draw the curve (i.e. the
  1168. + curve's marks, lines, and arrows).  0.0 (The default) is black.
  1169. + 1.0 is white.
  1170. + .TP
  1171. X  \fBfill \|[\fIfloat\fB\|]\fR   
  1172. X  This sets the filling of marks which define an area
  1173. X  to fill (e.g.  ``box'', ``circle'', ``xbar'').  1.0 fills the mark with
  1174. X  white.  0.0 fills it with black.  Anything in between is differing
  1175. X  levels of gray.  Anything negative fills it with nothing (i.e.  makes
  1176. ! it see-through).  The default is 0 (black).
  1177. X  .TP
  1178. X  \fBgmarks \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR   
  1179. X  \fBGmarks\fR
  1180. ! is a way for the user to define custom marks.  For each mark on 
  1181. X  \fB(x,y),\fR 
  1182. X  Each pair of 
  1183. X  \fB\|{\fIfloat_x\fB\|}, \|{\fIfloat_y\fB\|}, \fR
  1184. ***************
  1185. *** 512,529 ****
  1186. X    Thus, for example, the
  1187. X  ``box'' mark could be defined as ``\fIgmarks\fB -1 -1 -1 1 1 1 1 -1''.
  1188. X  .TP
  1189. X  \fBlinetype \|[\fItoken\fB\|]\fR   
  1190. ! This defines the type of the line connecting
  1191. ! the points.  Valid entries are ``solid'', ``dotted'', ``dashed'', and
  1192. ! ``none''.  The default is ``none''.  Points are connected in the order in
  1193. ! which they are inserted using the 
  1194. X  \fBpts\fR
  1195. X  command.
  1196. X  .TP
  1197. X  \fBlinethickness \|[\fIfloat\fB\|]\fR   
  1198. X  This defines the line thickness (in
  1199. X  absolute postscript units) of the connecting line.  Default = 1.0.
  1200. X  .TP
  1201. X  \fBlabel\fR   
  1202. X  This edits the label of this curve for the purposed of
  1203. X  drawing a legend.  (see LABEL EDITING COMMANDS and LEGEND EDITING
  1204. --- 587,664 ----
  1205. X    Thus, for example, the
  1206. X  ``box'' mark could be defined as ``\fIgmarks\fB -1 -1 -1 1 1 1 1 -1''.
  1207. X  .TP
  1208. + \fBlarrows\fR
  1209. + .br
  1210. + .ns
  1211. + .TP
  1212. + \fBrarrows\fR
  1213. + .br
  1214. + .ns
  1215. + .TP
  1216. + \fBnolarrows\fR
  1217. + .br
  1218. + .ns
  1219. + .TP
  1220. + \fBnorarrows\fR
  1221. + \fBRarrows\fR 
  1222. + specifies to draw an arrow at the end of every line
  1223. + segment in the curve.  
  1224. + \fBLarrows\fR 
  1225. + specifies to draw an arrow at the beginning of every line segment.
  1226. + The size of the arrows can be changed by using
  1227. + \fBasize\fR.
  1228. + The 
  1229. + \fBfill\fR
  1230. + token controls the filling of the head of the arrows.
  1231. + The default is
  1232. + \fBnolarrows\fR
  1233. + and
  1234. + \fBnorarrows\fR.
  1235. + .TP
  1236. + \fBasize \|[\fIfloat\fB\|] \|[\fIfloat\fB\|]\fR   
  1237. + This sets the size of the arrows.  The first 
  1238. + \fB\|[\fIfloat\fB\|] \fR
  1239. + controls the arrow's width.  Its units are those of the x-axis.
  1240. + The second
  1241. + \fB\|[\fIfloat\fB\|] \fR
  1242. + controls the arrow's height.  It is in the units of the y-axis.
  1243. + Use the -p option of jgraph to see the default values.
  1244. + .TP
  1245. X  \fBlinetype \|[\fItoken\fB\|]\fR   
  1246. ! This defines the type of the line connecting the points.  Valid
  1247. ! entries are ``solid'', ``dotted'', ``dashed'', ``longdash'',
  1248. ! ``dotdash'', ``dotdotdash'', ``dotdotdashdash'', ``general'', and
  1249. ! ``none''.  The default is ``none''.  ``General'' lets the user define
  1250. ! his own linetype using the
  1251. ! \fBglines\fR
  1252. ! command described below.  Points are connected in the
  1253. ! order in which they are inserted using the 
  1254. X  \fBpts\fR
  1255. X  command.
  1256. X  .TP
  1257. + \fBglines \|[\fIfloat\fB\|]*\fR   
  1258. + This lets the user specify the exact dashing of a line.  The format
  1259. + is as in postscript -- the first number is the length of the first
  1260. + dash, the second is the length of the space after the first dash,
  1261. + etc.  For example, ``dotdash'' could be defined as ``\fIglines\fB 5 3
  1262. + 1 3''.  
  1263. + .TP
  1264. X  \fBlinethickness \|[\fIfloat\fB\|]\fR   
  1265. X  This defines the line thickness (in
  1266. X  absolute postscript units) of the connecting line.  Default = 1.0.
  1267. X  .TP
  1268. + \fBclip\fR
  1269. + This specifies that this curve will be clipped -- that is,
  1270. + no points outside of the of axes will be plotted.  
  1271. + .TP
  1272. + \fBnoclip\fR
  1273. + This turns off clipping.  If clipping was specified for the 
  1274. + entire graph, then 
  1275. + \fBnoclip\fR
  1276. + has no effect.
  1277. + \fBNoclip\fR
  1278. + is the default.
  1279. + .TP
  1280. X  \fBlabel\fR   
  1281. X  This edits the label of this curve for the purposed of
  1282. X  drawing a legend.  (see LABEL EDITING COMMANDS and LEGEND EDITING
  1283. ***************
  1284. *** 694,699 ****
  1285. --- 829,839 ----
  1286. X  marks, labels, axes, etc.
  1287. X  .RS
  1288. X  .TP
  1289. + \fBgray \|[\fIfloat\fB\|]\fR   
  1290. + This specifies a gray-scale for drawing the axes (axis lines, hash
  1291. + marks, hash labels and grid lines).  The default is 0.0 (black). 
  1292. + 1.0 is white.
  1293. + .TP
  1294. X  \fBhash_at \|[\fIfloat\fB\|]\fR   
  1295. X  Draw a hash mark at this point.  No label is
  1296. X  made for this hash mark.
  1297. ***************
  1298. *** 928,934 ****
  1299. X  .SH EMBEDDING THE OUTPUT IN LATEX
  1300. X  I haven't read the manuals, but the way I've been loading these files
  1301. X  into LaTeX has been as follows:
  1302. ! .EX
  1303. X  1.  Toward the beginning of my LaTeX file, I've had ``\\input{psfig}''
  1304. X  2.  Where I've wanted my file, I've put:
  1305. X  
  1306. --- 1068,1075 ----
  1307. X  .SH EMBEDDING THE OUTPUT IN LATEX
  1308. X  I haven't read the manuals, but the way I've been loading these files
  1309. X  into LaTeX has been as follows:
  1310. ! .PP
  1311. ! .nf
  1312. X  1.  Toward the beginning of my LaTeX file, I've had ``\\input{psfig}''
  1313. X  2.  Where I've wanted my file, I've put:
  1314. X  
  1315. ***************
  1316. *** 943,949 ****
  1317. X  4.  If that doesn't work, try dvips-ing the file and printing the postscript,
  1318. X      and if that still doesn't work, try doing everything on a sun.
  1319. X  
  1320. ! .EE
  1321. X  .SH BUGS
  1322. X  If the 
  1323. X  \fBhash_scale \fR
  1324. --- 1084,1091 ----
  1325. X  4.  If that doesn't work, try dvips-ing the file and printing the postscript,
  1326. X      and if that still doesn't work, try doing everything on a sun.
  1327. X  
  1328. ! .fi
  1329. ! .PP
  1330. X  .SH BUGS
  1331. X  If the 
  1332. X  \fBhash_scale \fR
  1333. ***************
  1334. *** 953,957 ****
  1335. --- 1095,1106 ----
  1336. X  .sp
  1337. X  Logarithmic axes cannot contain points <= 0.  If I have 
  1338. X  enough complaints to convince me that this is a bug, I'll try to fix it.
  1339. + .sp
  1340. + If jgraph were really smart, then it would have arrow-heads go to the
  1341. + edge of standard marks like circles, etc.  Someday.
  1342. + .sp
  1343. + There is no real way to make the axes such that they decrease from 
  1344. + left to right or low to high -- or at least not without writing your
  1345. + own hash labels.  
  1346. X  .sp
  1347. X  There may well be loads of other bugs.  Send to jsp@princeton.edu.
  1348. *** ../work/jgraph.c    Tue Oct  8 17:36:20 1991
  1349. --- jgraph.c    Tue Oct  8 16:55:15 1991
  1350. ***************
  1351. *** 1,7 ****
  1352. X  /* 
  1353. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.c,v $
  1354. !  * $Revision: 5.0 $
  1355. !  * $Date: 91/05/02 14:45:13 $
  1356. X   * $Author: jsp $
  1357. X   */
  1358. X  
  1359. --- 1,7 ----
  1360. X  /* 
  1361. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.c,v $
  1362. !  * $Revision: 6.0 $
  1363. !  * $Date: 91/10/08 16:53:48 $
  1364. X   * $Author: jsp $
  1365. X   */
  1366. X  
  1367. ***************
  1368. *** 47,54 ****
  1369. --- 47,57 ----
  1370. X    new_c = (Curve) get_node(c);
  1371. X    new_c->num = num;
  1372. X    new_c->l = new_label();
  1373. +   new_c->clip = 0;
  1374. +   new_c->gray = 0.0;
  1375. X    
  1376. X    new_c->pts = (Point) make_list(sizeof(struct point));
  1377. +   new_c->gen_linetype = (Flist) make_list(sizeof(struct flist));
  1378. X    new_c->marktype = MARKTYPES[num % NORMALMARKTYPES];
  1379. X    new_c->linetype = '0';
  1380. X    new_c->linethick = 1.0;
  1381. ***************
  1382. *** 56,64 ****
  1383. X    new_c->marksize[1] = FSIG;
  1384. X    new_c->general_marks = (Point) make_list(sizeof(struct point));
  1385. X    i = num / NORMALMARKTYPES;
  1386. !   if (i == 0) new_c->fill = 0.0;
  1387. !   else if (i == 1) new_c->fill = 1.0;
  1388. !   else new_c->fill = -1.0;
  1389. X    prio_insert(new_c, c, 0);
  1390. X    return new_c;
  1391. X  }
  1392. --- 59,69 ----
  1393. X    new_c->marksize[1] = FSIG;
  1394. X    new_c->general_marks = (Point) make_list(sizeof(struct point));
  1395. X    i = num / NORMALMARKTYPES;
  1396. !   new_c->fill = 0.0;
  1397. !   new_c->rarrows = 0;
  1398. !   new_c->larrows = 0;
  1399. !   new_c->asize[0] = FSIG;
  1400. !   new_c->asize[1] = FSIG;
  1401. X    prio_insert(new_c, c, 0);
  1402. X    return new_c;
  1403. X  }
  1404. ***************
  1405. *** 113,118 ****
  1406. --- 118,125 ----
  1407. X    a->auto_hash_marks = 1;
  1408. X    a->start_given = 0;
  1409. X    a->hash_scale = -1.0;
  1410. +   a->grid_lines = 0;
  1411. +   a->gray = 0.0;
  1412. X    a->is_x = is_x;
  1413. X    a->is_lg = 0;
  1414. X    a->hash_labels = (String) make_list (sizeof(struct string));
  1415. ***************
  1416. *** 206,211 ****
  1417. --- 213,220 ----
  1418. X    g->curves = (Curve) make_list(sizeof(struct curve));
  1419. X    g->strings = (String) make_list(sizeof(struct string));
  1420. X    g->title = new_title();
  1421. +   g->clip = 0;
  1422. +   g->border = 0;
  1423. X    g->legend = new_legend();
  1424. X  /*  g->def = new_default(); */
  1425. X    prio_insert(g, gs, 0);
  1426. ***************
  1427. *** 222,250 ****
  1428. X    return new_g;
  1429. X  }
  1430. X  
  1431. X  main(argc, argv)
  1432. X  int argc;
  1433. X  char **argv;
  1434. X  {
  1435. !   struct graphs gs;
  1436. X    int i;
  1437. !   char show;
  1438. X  
  1439. X  #ifdef VMS 
  1440. X    IOSTREAM = stdin;    /* for token.c -hdd */
  1441. X  #endif
  1442. X    show = 0;
  1443. !   gs.g = (Graph) make_list(sizeof(struct graph));
  1444. !   gs.height = 0.0;
  1445. !   gs.width = 0.0;        /* added -hdd */
  1446. !   gs.printable_postscript = 0;
  1447. !   edit_graphs(&gs);
  1448. !   process_graphs(&gs);
  1449. X    for (i = 1; i < argc; i++) {
  1450. X      if (strcmp(argv[i], "-p") == 0) show = 1;
  1451. !     else if (strcmp(argv[i], "-P") == 0) gs.printable_postscript = 1;
  1452. X    }
  1453. !   if (show) show_graphs(&gs); else draw_graphs(&gs);
  1454. X  }
  1455. X  
  1456. X  
  1457. --- 231,273 ----
  1458. X    return new_g;
  1459. X  }
  1460. X  
  1461. + new_graphs(gs)
  1462. + Graphs gs;
  1463. + {
  1464. +   Graphs newg;
  1465. +   newg = (Graphs) get_node(gs);
  1466. +   newg->g = (Graph) make_list(sizeof(struct graph));
  1467. +   newg->height = 0.0;
  1468. +   newg->width = 0.0;
  1469. +   newg->bb[0] = FSIG; newg->bb[1] = FSIG;
  1470. +   newg->bb[2] = FSIG; newg->bb[3] = FSIG;
  1471. +   insert(newg, gs);
  1472. + }
  1473. X  main(argc, argv)
  1474. X  int argc;
  1475. X  char **argv;
  1476. X  {
  1477. !   Graphs gs;
  1478. X    int i;
  1479. !   int show, pp;
  1480. X  
  1481. X  #ifdef VMS 
  1482. X    IOSTREAM = stdin;    /* for token.c -hdd */
  1483. X  #endif
  1484. X    show = 0;
  1485. !   pp = 0;
  1486. X    for (i = 1; i < argc; i++) {
  1487. X      if (strcmp(argv[i], "-p") == 0) show = 1;
  1488. !     else if (strcmp(argv[i], "-P") == 0) pp = 1;
  1489. X    }
  1490. !   gs = (Graphs) make_list(sizeof(struct graphs));
  1491. !   new_graphs(gs, pp);
  1492. !   edit_graphs(gs);
  1493. !   process_graphs(gs);
  1494. !   if (show) show_graphs(gs); else draw_graphs(gs, pp);
  1495. !   exit(0);
  1496. X  }
  1497. X  
  1498. X  
  1499. *** /dev/null    Tue Oct  8 02:00:06 1991
  1500. --- jgraph.com    Tue Oct  8 16:55:15 1991
  1501. ***************
  1502. *** 0 ****
  1503. --- 1,39 ----
  1504. + $!  JGRAPH.COM: Execute jgraph on VMS.
  1505. + $   SAVE_VER = 'F$VERIFY( F$TRNLNM( "JGRAPH_VERIFY"))'
  1506. + $ ! How to use this procedure:
  1507. + $ ! (1) define a symbol to execute the command file
  1508. + $ !      $ JGRAPH :== @dev:[directory]JGRAPH.COM
  1509. + $ !     We will assume that both this jgraph.com and jgraph.exe reside
  1510. + $ !     in dev:[directory].
  1511. + $ ! (2) Then, to run the program with say the HYPERCUBE.JGR file,
  1512. + $ !      $ JGRAPH HYPERCUBE      ! (Yes you can leave off the .JGR extension)
  1513. + $ !     To generate a stand-alone PostScript file that can be sent directly
  1514. + $ !    to the printer, use:
  1515. + $ !      $ JGRAPH HYPERCUBE "-P"
  1516. + $ !    or simply
  1517. + $ !      $ JGRAPH HYPERCUBE -P
  1518. + $ !     If you really want lowercase to reprint input in expanded form:
  1519. + $ !      $ JGRAPH HYPERCUBE "-p"
  1520. + $ !    The resulting output file will have a ".jps" extension.
  1521. + $!
  1522. + $   ON   ERROR   THEN GOTO EXIT
  1523. + $   ON CONTROL_Y THEN GOTO EXIT
  1524. + $!
  1525. + $L1:
  1526. + $   P1 = F$SEARCH( F$PARSE( P1, ".JGR"))
  1527. + $   IF P1 .NES. "" THEN GOTO L2
  1528. + $   INQUIRE /LOCAL P1 "Input File : "
  1529. + $   GOTO L1
  1530. + $L2:
  1531. + $   JPS_FILE  = F$PARSE( P1,,, "NAME") + ".JPS"
  1532. + $   THIS_FILE = F$ENVIRONMENT("PROCEDURE")
  1533. + $   HERE = F$PARSE(THIS_FILE,,,"DEVICE",) + F$PARSE(THIS_FILE,,,"DIRECTORY",)
  1534. + $   RUN_JGRAPH := $'HERE'JGRAPH
  1535. + $!
  1536. + $   TMP = F$VERIFY( 1)
  1537. + $   RUN_JGRAPH <'p1' >'jps_file' "''P2'"
  1538. + $   $status = $STATUS
  1539. + $   TMP = 'F$VERIFY( TMP)
  1540. + $!
  1541. + $EXIT:
  1542. + $   EXIT $status + 0*F$VERIFY( SAVE_VER)
  1543. *** ../work/jgraph.h    Tue Oct  8 17:36:21 1991
  1544. --- jgraph.h    Tue Oct  8 16:55:15 1991
  1545. ***************
  1546. *** 1,7 ****
  1547. X  /* 
  1548. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.h,v $
  1549. !  * $Revision: 5.0 $
  1550. !  * $Date: 91/05/02 14:46:24 $
  1551. X   * $Author: jsp $
  1552. X   */
  1553. X  
  1554. --- 1,7 ----
  1555. X  /* 
  1556. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.h,v $
  1557. !  * $Revision: 6.0 $
  1558. !  * $Date: 91/10/08 16:53:50 $
  1559. X   * $Author: jsp $
  1560. X   */
  1561. X  
  1562. ***************
  1563. *** 28,33 ****
  1564. --- 28,39 ----
  1565. X    float y;
  1566. X  } *Point;
  1567. X  
  1568. + typedef struct flist {
  1569. +   struct flist *flink;
  1570. +   struct flist *blink;
  1571. +   float f;
  1572. + } *Flist;
  1573. X  typedef struct label {
  1574. X    char *label;
  1575. X    float x;
  1576. ***************
  1577. *** 48,56 ****
  1578. --- 54,68 ----
  1579. X    Point general_marks;
  1580. X    float marksize[2];
  1581. X    float fill;
  1582. +   float gray;
  1583. X    float linethick;
  1584. +   Flist gen_linetype;
  1585. X    char marktype;
  1586. X    char linetype;
  1587. +   int rarrows;
  1588. +   int larrows;
  1589. +   float asize[2];
  1590. +   int clip;
  1591. X  } *Curve;
  1592. X  
  1593. X  typedef struct string {
  1594. ***************
  1595. *** 99,104 ****
  1596. --- 111,118 ----
  1597. X    float draw_hash_marks_at;
  1598. X    float draw_hash_labels_at;
  1599. X    float draw_at;
  1600. +   float gray;
  1601. +   int grid_lines;
  1602. X    int draw_hash_labels;
  1603. X    int draw_axis_line;
  1604. X    int draw_hash_marks;
  1605. ***************
  1606. *** 121,127 ****
  1607. X    float size;
  1608. X    int anylines;
  1609. X    float midspace;
  1610. !   char type; /* 'n' = off, 't' = top, 'r' = right, 'u' = userdefined, 'c' = custom */
  1611. X  } *Legend;
  1612. X  
  1613. X  typedef struct graph {
  1614. --- 135,142 ----
  1615. X    float size;
  1616. X    int anylines;
  1617. X    float midspace;
  1618. !   char type; /* 'n' = off, 't' = top, 'r' = right, 
  1619. !                 'u' = userdefined, 'c' = custom */
  1620. X  } *Legend;
  1621. X  
  1622. X  typedef struct graph {
  1623. ***************
  1624. *** 137,151 ****
  1625. X    Legend legend;
  1626. X    String strings;
  1627. X    Label title;
  1628. X    Default def;
  1629. X  } *Graph;
  1630. X  
  1631. X  typedef struct graphs {
  1632. X    Graph g;
  1633. X    float height;
  1634. X    float width;
  1635. X    float bb[4]; /* Bounding box */
  1636. -   char printable_postscript;
  1637. X  } *Graphs;
  1638. X  
  1639. X  extern float ctop();
  1640. --- 152,169 ----
  1641. X    Legend legend;
  1642. X    String strings;
  1643. X    Label title;
  1644. +   int clip;
  1645. +   int border;
  1646. X    Default def;
  1647. X  } *Graph;
  1648. X  
  1649. X  typedef struct graphs {
  1650. +   struct graphs *flink;
  1651. +   struct graphs *blink;
  1652. X    Graph g;
  1653. X    float height;
  1654. X    float width;
  1655. X    float bb[4]; /* Bounding box */
  1656. X  } *Graphs;
  1657. X  
  1658. X  extern float ctop();
  1659. *** ../work/list.c    Tue Oct  8 17:36:22 1991
  1660. --- list.c    Tue Oct  8 16:55:16 1991
  1661. ***************
  1662. *** 1,7 ****
  1663. X  /* 
  1664. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.c,v $
  1665. !  * $Revision: 5.0 $
  1666. !  * $Date: 91/05/02 14:45:14 $
  1667. X   * $Author: jsp $
  1668. X   */
  1669. X  
  1670. --- 1,7 ----
  1671. X  /* 
  1672. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.c,v $
  1673. !  * $Revision: 6.0 $
  1674. !  * $Date: 91/10/08 16:53:51 $
  1675. X   * $Author: jsp $
  1676. X   */
  1677. X  
  1678. *** ../work/list.h    Tue Oct  8 17:36:23 1991
  1679. --- list.h    Tue Oct  8 16:55:16 1991
  1680. ***************
  1681. *** 1,7 ****
  1682. X  /* 
  1683. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.h,v $
  1684. !  * $Revision: 5.0 $
  1685. !  * $Date: 91/05/02 14:46:26 $
  1686. X   * $Author: jsp $
  1687. X   */
  1688. X  
  1689. --- 1,7 ----
  1690. X  /* 
  1691. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.h,v $
  1692. !  * $Revision: 6.0 $
  1693. !  * $Date: 91/10/08 16:53:52 $
  1694. X   * $Author: jsp $
  1695. X   */
  1696. X  
  1697. *** ../work/printline.c    Tue Oct  8 17:36:25 1991
  1698. --- printline.c    Tue Oct  8 16:55:16 1991
  1699. ***************
  1700. *** 1,7 ****
  1701. X  /* 
  1702. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/printline.c,v $
  1703. !  * $Revision: 5.0 $
  1704. !  * $Date: 91/05/02 14:45:15 $
  1705. X   * $Author: jsp $
  1706. X   */
  1707. X  
  1708. --- 1,7 ----
  1709. X  /* 
  1710. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/printline.c,v $
  1711. !  * $Revision: 6.0 $
  1712. !  * $Date: 91/10/08 16:53:54 $
  1713. X   * $Author: jsp $
  1714. X   */
  1715. X  
  1716. ***************
  1717. *** 21,32 ****
  1718. X      printf("newpath %f %f moveto %f %f lineto stroke\nstroke\n",
  1719. X            y1, x1, y2, x2);} 
  1720. X  
  1721. ! start_line(x1, y1, thickness, style)
  1722. ! float x1, y1, thickness;
  1723. ! char style;
  1724. X  {
  1725. !   setlinewidth(thickness);
  1726. !   setlinestyle(style);
  1727. X    printf("%f %f moveto ", x1, y1);
  1728. X  }
  1729. X  
  1730. --- 21,32 ----
  1731. X      printf("newpath %f %f moveto %f %f lineto stroke\nstroke\n",
  1732. X            y1, x1, y2, x2);} 
  1733. X  
  1734. ! start_line(x1, y1, c)
  1735. ! float x1, y1;
  1736. ! Curve c;
  1737. X  {
  1738. !   setlinewidth(c->linethick);
  1739. !   setlinestyle(c->linetype, c->gen_linetype);
  1740. X    printf("%f %f moveto ", x1, y1);
  1741. X  }
  1742. X  
  1743. ***************
  1744. *** 40,46 ****
  1745. X  {
  1746. X    printf("stroke\n stroke\n");
  1747. X    setlinewidth(1.0);
  1748. !   setlinestyle('s');
  1749. X  
  1750. X  }
  1751. X  
  1752. --- 40,46 ----
  1753. X  {
  1754. X    printf("stroke\n stroke\n");
  1755. X    setlinewidth(1.0);
  1756. !   setlinestyle('s', (Flist) 0);
  1757. X  
  1758. X  }
  1759. X  
  1760. ***************
  1761. *** 129,142 ****
  1762. X    printf("%f setlinewidth\n", size * LINEWIDTHFACTOR);
  1763. X  }
  1764. X  
  1765. ! setlinestyle(style)
  1766. X  char style;
  1767. X  {
  1768. X    switch(style) {
  1769. X      case '0': 
  1770. X      case 's': printf("\t[] 0 setdash\n"); break;
  1771. X      case '.': printf("\t [1 3.200000] 0 setdash\n"); break;
  1772. X      case '-': printf("\t [4.00000] 0 setdash\n"); break;
  1773. X      default: fprintf(stderr, "Error: Unknown line type: %c\n", style);
  1774. X               exit(1);
  1775. X               break;
  1776. --- 129,155 ----
  1777. X    printf("%f setlinewidth\n", size * LINEWIDTHFACTOR);
  1778. X  }
  1779. X  
  1780. ! setlinestyle(style, glist)
  1781. X  char style;
  1782. + Flist glist;
  1783. X  {
  1784. +   Flist fl;
  1785. X    switch(style) {
  1786. X      case '0': 
  1787. X      case 's': printf("\t[] 0 setdash\n"); break;
  1788. X      case '.': printf("\t [1 3.200000] 0 setdash\n"); break;
  1789. X      case '-': printf("\t [4.00000] 0 setdash\n"); break;
  1790. +     case 'l': printf("\t [7 2] 0 setdash\n"); break;
  1791. +     case 'd': printf("\t [5 3 1 3] 0 setdash\n"); break;
  1792. +     case 'D': printf("\t [5 3 1 2 1 3] 0 setdash\n"); break;
  1793. +     case '2': printf("\t [5 3 5 3 1 2 1 3] 0 setdash\n"); break;
  1794. +     case 'g': 
  1795. +       printf("\t [");
  1796. +       for (fl = first(glist); fl != nil(glist); fl = next(fl))
  1797. +         printf("%f ", fl->f);
  1798. +       printf("] 0 setdash\n");
  1799. +       break;
  1800. X      default: fprintf(stderr, "Error: Unknown line type: %c\n", style);
  1801. X               exit(1);
  1802. X               break;
  1803. *** ../work/prio_list.c    Tue Oct  8 17:36:26 1991
  1804. --- prio_list.c    Tue Oct  8 16:55:16 1991
  1805. ***************
  1806. *** 1,7 ****
  1807. X  /* 
  1808. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.c,v $
  1809. !  * $Revision: 5.0 $
  1810. !  * $Date: 91/05/02 14:45:17 $
  1811. X   * $Author: jsp $
  1812. X   */
  1813. X  
  1814. --- 1,7 ----
  1815. X  /* 
  1816. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.c,v $
  1817. !  * $Revision: 6.0 $
  1818. !  * $Date: 91/10/08 16:53:55 $
  1819. X   * $Author: jsp $
  1820. X   */
  1821. X  
  1822. *** ../work/prio_list.h    Tue Oct  8 17:36:27 1991
  1823. --- prio_list.h    Tue Oct  8 16:55:17 1991
  1824. ***************
  1825. *** 1,7 ****
  1826. X  /* 
  1827. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.h,v $
  1828. !  * $Revision: 5.0 $
  1829. !  * $Date: 91/05/02 14:46:27 $
  1830. X   * $Author: jsp $
  1831. X   */
  1832. X  
  1833. --- 1,7 ----
  1834. X  /* 
  1835. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.h,v $
  1836. !  * $Revision: 6.0 $
  1837. !  * $Date: 91/10/08 16:53:56 $
  1838. X   * $Author: jsp $
  1839. X   */
  1840. X  
  1841. *** ../work/process.c    Tue Oct  8 17:36:28 1991
  1842. --- process.c    Tue Oct  8 16:55:17 1991
  1843. ***************
  1844. *** 1,7 ****
  1845. X  /* 
  1846. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/process.c,v $
  1847. !  * $Revision: 5.0 $
  1848. !  * $Date: 91/05/02 14:45:18 $
  1849. X   * $Author: jsp $
  1850. X   */
  1851. X  
  1852. --- 1,7 ----
  1853. X  /* 
  1854. X   * $Source: /n/fs/vd/jsp/src/jgraph/RCS/process.c,v $
  1855. !  * $Revision: 6.0 $
  1856. !  * $Date: 91/10/08 16:53:56 $
  1857. X   * $Author: jsp $
  1858. X   */
  1859. X  
  1860. ***************
  1861. *** 141,177 ****
  1862. X  Axis a;
  1863. X  {
  1864. X    int i, b, b2, done;
  1865. !   float x, x2;
  1866. X  
  1867. !   x2 = 0.0;
  1868. X    b = 0;
  1869. X    x = a->hash_interval;
  1870. X  
  1871. X    done = 0;
  1872. X    while(b < 6 && !done) {
  1873. !     i = (int) ((x - x2));
  1874. X      x2 = i;
  1875. !     if (x2 - x < .0000001 && x - x2 < .0000001) done = 1;
  1876. X      else {
  1877. X        b++;
  1878. -       x2 *= 10.0;
  1879. X        x *= 10.0;
  1880. X      }
  1881. X    }
  1882. X  
  1883. !   x2 = 0.0;
  1884. X    b2 = 0;
  1885. X    x = a->hash_start;
  1886. X  
  1887. X    done = 0;
  1888. X    while(b2 < 6 && !done) {
  1889. !     i = (int) (x - x2);
  1890. X      x2 = i;
  1891. !     if (x2 - x < .0000001 && x - x2 < .0000001) done = 1;
  1892. X      else {
  1893. X        b2++;
  1894. -       x2 *= 10.0;
  1895. X        x *= 10.0;
  1896. X      }
  1897. X    }
  1898. X    return MAX(b, b2);
  1899. --- 141,177 ----
  1900. X  Axis a;
  1901. X  {
  1902. X    int i, b, b2, done;
  1903. !   float x, x2, tolerance;
  1904. X  
  1905. !   tolerance = 0.000001;
  1906. X    b = 0;
  1907. X    x = a->hash_interval;
  1908. X  
  1909. X    done = 0;
  1910. X    while(b < 6 && !done) {
  1911. !     i = (int) (x + 0.4);
  1912. X      x2 = i;
  1913. !     if (x2 - x < tolerance && x - x2 < tolerance) done = 1;
  1914. X      else {
  1915. X        b++;
  1916. X        x *= 10.0;
  1917. +       tolerance *= 10.0;
  1918. X      }
  1919. X    }
  1920. X  
  1921. !   tolerance = 0.000001;
  1922. X    b2 = 0;
  1923. X    x = a->hash_start;
  1924. X  
  1925. X    done = 0;
  1926. X    while(b2 < 6 && !done) {
  1927. !     i = (int) (x + 0.4);
  1928. X      x2 = i;
  1929. !     if (x2 - x < tolerance && x - x2 < tolerance) done = 1;
  1930. X      else {
  1931. X        b2++;
  1932. X        x *= 10.0;
  1933. +       tolerance *= 10.0;
  1934. X      }
  1935. X    }
  1936. X    return MAX(b, b2);
  1937. ***************
  1938. *** 323,330 ****
  1939. X              if (ABS(t1) >= 1.0 || t1 == 0.0) prec = 0;
  1940. X              else {
  1941. X                tmp = ABS(t1);
  1942. !               prec = 2;
  1943. !               while(tmp < 0.0) {tmp *= 10.0; prec++;}
  1944. X              }
  1945. X            }
  1946. X            sprintf(s->s->label, "%.*f", prec, t1);
  1947. --- 323,330 ----
  1948. X              if (ABS(t1) >= 1.0 || t1 == 0.0) prec = 0;
  1949. X              else {
  1950. X                tmp = ABS(t1);
  1951. !               prec = -1;
  1952. !               while(tmp < 1.0) {tmp *= 10.0; prec++;}
  1953. X              }
  1954. X            }
  1955. X            sprintf(s->s->label, "%.*f", prec, t1);
  1956. ***************
  1957. *** 441,446 ****
  1958. --- 441,450 ----
  1959. X                     4.0 : disttop(c->marksize[0], g->x_axis);
  1960. X    c->marksize[1] = (c->marksize[1] == FSIG) ? 
  1961. X                     4.0 : disttop(c->marksize[1], g->y_axis);
  1962. +   c->asize[0] = (c->asize[0] == FSIG) ? 
  1963. +                    6.0 : disttop(c->asize[0], g->x_axis);
  1964. +   c->asize[1] = (c->asize[1] == FSIG) ? 
  1965. +                    2.0 : disttop(c->asize[1], g->y_axis);
  1966. X  }
  1967. X  
  1968. X  process_curves(g)
  1969. ***************
  1970. *** 470,495 ****
  1971. X  process_graphs(gs)
  1972. X  Graphs gs;
  1973. X  {
  1974. X    Graph g;
  1975. X    float tmp_x, x, max_y, min_y;
  1976. X  
  1977. !   for (g = first(gs->g); g != nil(gs->g); g = next(g)) process_graph(g);
  1978. SHAR_EOF
  1979. true || echo 'restore of patch.6 failed'
  1980. fi
  1981. echo 'End of  part 1'
  1982. echo 'File patch.6 is continued in part 2'
  1983. echo 2 > _shar_seq_.tmp
  1984. exit 0
  1985. exit 0 # Just in case...
  1986. -- 
  1987. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1988. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1989. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1990. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1991.